import java.util.Random;

public class Daji_05 {

    static void drawOne(Dad dad){
        dad.draw();
    }

    static void draws(Dad[] dads){
        for(int i=0; i< dads.length; i++){
            dads[i].draw();
        }
    }
    public static void main(String arg[]){
        Random random = new Random();
        Dad[] dad = new Dad[10];
        for(int i=0; i< dad.length; i++){
            switch (random.nextInt(3)){
                case 0:dad[i] = new son1();break;
                case 1:dad[i] = new son2();break;
                case 2:dad[i] = new son3();break;
            }
        }
        draws(dad);
    }
}

class Dad{
    void draw(){};
    void print(){};
}

class son1 extends Dad{
    void draw(){
        System.out.println("son1");
    }
}

class son2 extends Dad{
    void draw(){
        System.out.println("son2");
    }
}

class son3 extends Dad{
    void draw(){
        System.out.println("son3");
    }
}
